<template>
	<view class="mybaobei p18">
		<myNav>
			<view slot="left" @click="back"><uni-icons type="closeempty" color="#fff"></uni-icons></view>
			<view class="center">新增跟进</view>
		</myNav>
		<view class="list">
			跟进方式*
			<!-- <image src="../../static/all/baobei/icon2-1.jpg" mode=""></image> -->
			<image
				class="myinmg"
				:src="item ? `/static/all/baobei/icon${index}.jpg` : `/static/all/baobei/icon${index}-1.jpg`"
				mode=""
				v-for="(item, index) in list"
				@click="changelist(index)"
				:key="index"
			></image>
		</view>
		<view class="list">
			跟进方式*
			<!-- <image src="../../static/all/dengji/icon0.png" mode=""></image> -->
			<image
				class="myinmg mygd"
				
				:src="index2===index? `/static/all/dengji/icon${index}.png` : `/static/all/dengji/icon${index}-1.png`"
				mode=""
				v-for="(item, index) in 5"
				@click="index2=index"
				:key="index"
			></image>
		</view>
		<view class="list" style="flex-direction: column;">
			<text style="align-self: flex-start;">跟进方式*</text>
			<!-- <image src="../../static/all/dengji/icon0.png" mode=""></image> -->
			<textarea class="biankuang" value="" placeholder="咨询意愿，确定购买意向，指定计划" />
		</view>
		<view class="list" style="margin: 20px 0;">
			<text >下次跟进时间:  </text>
			<!-- <image src="../../static/all/dengji/icon0.png" mode=""></image> -->
			<picker mode="date"  @change="changetime">
				<text >{{info.time}}</text>
			</picker>
		</view>
		<view class="list" style="margin: 20px 0;">
			
			<!-- <image src="../../static/all/dengji/icon0.png" mode=""></image> -->
			<picker mode="selector" :range="loupan" @change="changeloupan">
				<text >楼盘: {{info.loupan}}</text>
			</picker>
		</view>
		<view class="btn" @click="queding">保存</view>

	</view>
</template>

<script>
import { mapMutations } from 'vuex';
import Prompt from '@/components/zz-prompt/index.vue';
import myNav from '../../components/mynav/mynav.vue';
import { visitor } from '@/api/index.js';
import { MyShow } from '@/util/my.js';
export default {
	components: { myNav, Prompt },
	data() {
		
		return {
			index: 1,
			promptVisible: false,
			biaoqian: '', //用户自定义标签输入内容
			list: [false, false, false, false, false],
			index2:"",
			show: false,
			mytagindex: '',
			loupan:['楼盘: 测试楼盘1号','楼盘: 测试楼盘2号','楼盘: 测试楼盘3号'],
			info: {
				loupanindex: '',
				time:"2020-3-1",
				loupan:""
				
			}
		};
	},
	methods: {
		...mapMutations(['back']),
		changetime(e){
			console.log(e)
			this.info.time=e.mp.detail.value;
		},
		changelist(val) {
			this.list[val] = !this.list[val];
			this.list = [...this.list];
		},
		tuichu() {
			uni.navigateTo({
				url: '../zhuce/zhuce'
			});
		},
		changeloupan(e){
			console.log(e)
			this.info.loupan=this.loupan[e.mp.detail.value]
		},
		async queding() {
			//去请求接口
			//  todo 字段自己填充吧
			// console.log('去请求接口');
			// try {
			// 	let reslut = await visitor(this.info);
			// 	//成功
			// 	new MyShow('需要渲染的字段').tixing();
			// } catch (e) {
			// 	//TODO handle the exception
			// 	new MyShow('需要渲染的字段').tixing();
			// }
			// this.show = false;
		},
	}
};
</script>

<style lang="scss">
@import './main.scss';
.myright {
	display: flex;
	flex-direction: column;
	image {
		width: 20px;
		height: 20px;
	}
	margin-top: 40px;
	align-items: center;
	color: #ffffff;
	text {
		margin-top: 5px;
	}
}
</style>
